/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2023 —11 —11
 * Time: 14:48
 */

public class Person {
    //类内，封装name
    private String name;
    public int age;
    public Person(){
        System.out.println("不带参数的构造方法！");
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("带2个参数的构造方法");
    }

    public String getName(){
        return this.name;
    }

    public void steName(String name){
        this.name = name;
    }


    public void sleep(){
        System.out.println(this.name+"正在睡瞌睡");
    }
}
